include ../Make.rule

BIN_PATH = ../../bin/
CPP_FILES += $(wildcard *.cpp)
H_FILES += $(wildcard *.h)

INC +=
LIBS += -lpthread

OBJ_DIR = ./obj/
$(shell if [ ! -d $(OBJ_DIR) ]; then mkdir $(OBJ_DIR); fi;)
OBJS := $(patsubst %.cpp, $(OBJ_DIR)%.o, $(CPP_FILES))

BIN := AStar
TARGET := $(BIN_PATH)$(BIN)

$(TARGET):$(OBJS) $(H_FILES)
	@echo link... $(TARGET)
	$(CXX) $(CXXFLAGS) -o $@ $(OBJS) $(INC) $(LIBS)

$(OBJ_DIR)%.o:%.cpp
	$(CXX) $(CXXFLAGS) -c -o $@ $< $(INC)

clean:
	rm -f $(OBJ_DIR)* $(TARGET)
